# -*- coding: utf-8 -*-
"""
 @Time    : 2021/2/4 下午6:21
 @Author  : tgy
 
"""







def run(func, args, *, call_back):
    ...
    res = func(*args)
    call_back(res)


def func_cb(param):
    print(param)


def yeild_cb():
    ...
    res = yield
    print(res)


def add(x,y):
    return x + y


def test01():
    ...
    run(add,(1,2),call_back=func_cb)
    y_cb = yeild_cb()
    next(y_cb)

    run(add,(1,2),call_back=y_cb.send)


if __name__ == '__main__':
    ...
    test01()
